Release 10.1A: OpenEdge Development:
ProDataSets
Creating a dynamic ProDataSet
Here is the syntax for dynamically creating a ProDataSet:
Instead of defining a static ProDataSet, you create a dynamic ProDataSet when part or all of its definition has to be determined at run time. For example, you might need data in the application or from specific user requests to define your ProDataSet. The
Note: If you do not specify theCREATE DATASETstatement gives you a handle in the variabledataset-handle, which you can then use to build up the ProDataSet through additional statements that add buffers and relations to it, much as you build up a dynamic query or temp-table.WIDGET-POOLpoolnamesyntax to allocate storage in a specific named widget pool, you might expect that the ProDataSet will be created in the closest unnamed widget pool. This is the default behavior for other objects such as dynamic queries. Instead, the ProDataSet goes into the session’s unnamed widget pool. This is necessary because the ProDataSet object must be able to serve as an output parameter. Therefore, the object cannot disappear when its defining procedure returns. Deletion must be delayed until the object can be handed off as an output parameter to the calling procedure. Likewise, the ProDataSet cannot go into a pool that is deleted when the procedure is deleted. If you give a pool name for an output parameter ProDataSet, remember that the pool must outlive the procedure where it is created.The
CREATEstatement simply allocates storage for the ProDataSet description and puts a pointer to that storage into thedataset-handlevariable. You must then run methods on the ProDataSet handle to define its buffers and relations. At this point, you can:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |